/**
 * Created by webhugo on 16-10-23.
 */

var sequelizex = require('sequelize-short');
var shortDataTypes = sequelizex.DataTypes;

module.exports = (sequelize, DataTypes) =>{

    return sequelize.define('Lesson', {
        title: shortDataTypes.String(),
        timeLength: shortDataTypes.String(),//时长
        level: shortDataTypes.Int(),//1为标清,2是高清
    }, {
        associate: function (models) {
            models.Chapter.hasMany(models.Lesson);
            models.Lesson.belongsTo(models.Chapter);

        },
        instanceMethods: {}
    });
};
